#include "SharePointerTest.h"

SharePointerTestA::SharePointerTestA()
{
}

SharePointerTestA::~SharePointerTestA()
{
    std::cout<<"destructor sharepointertestA"<<std::endl;
}

void SharePointerTestA::testThisPointer()
{
    std::shared_ptr<SharePointerTestA> myPtr(shared_from_this());
    std::cout<<"SharePtr Count:"<<myPtr.use_count()<<std::endl;
}

void SharePointerTestA::print()
{
    std::cout<<"this is a test"<<std::endl;
}

SharePointerTestB::SharePointerTestB()
{

}

SharePointerTestB::~SharePointerTestB()
{
    std::cout<<"destructor sharepointertestB"<<std::endl;
}

void SharePointerTestB::print()
{
    std::cout<<"this is a test b"<<std::endl;
}

SharedPointerTestC::SharedPointerTestC()
{

}

SharedPointerTestC::~SharedPointerTestC()
{
    std::cout<<"destructor sharepointertestC"<<std::endl;
}

void SharedPointerTestC::print()
{
    std::cout<<"this is a test c"<<std::endl;
}

void SharedPointerTestC::setValue(int nValue)
{
    std::cout<<"setValue"<<nValue<<std::endl;
}
